from game import Game
import pygame
from player1 import Player1
from player2 import Player2
from wall import Wall
from portal import Portal
from monster import Monster
from mini_portal1 import Portal_mini1
from mini_portal2 import Portal_mini2


def level1():
    Game.player1 = Player1(0, 500, 4)
    Game.playerGroup = pygame.sprite.Group()
    Game.playerGroup.add(Game.player1)

    Game.player2 = Player2(50, 500, 4)
    Game.playerGroup2 = pygame.sprite.Group()
    Game.playerGroup2.add(Game.player2)

    Game.wall = Wall()
    Game.portal = Portal(1500, 600)
    Game.monster = Monster(10, 10, 2)
    Game.level_text = "关卡1"
    # [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    # [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
    Game.wall_list = [
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 1, 1, 1, 1],
        [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
        [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
    ]
    Game.mini_portal1 = Portal_mini1(-100, 600)
    Game.mini_portal2 = Portal_mini2(-100, 750)
    # 初始化计数器
    count = 0
    Game.fangkuaixiaoshi = False
    # 遍历二维列表，找出所有的5并计数
    for row in Game.wall_list:
        for element in row:
            if element == 5:
                count += 1

    for row in Game.wall_list:
        for element in row:
            if element == 6:
                count += 1

    print(f"二维列表中值为5的元素数量为：{count}")

    Game.monster_list = [

    ]

    Game.monster1_star = 250
    Game.monster1_end = 750

    Game.monster2_star = 150
    Game.monster2_end = 550

    Game.monster3_star = 950
    Game.monster3_end = 1250

    Game.monster4_star = 300
    Game.monster4_end = 700

    Game.monster5_star = 600
    Game.monster5_end = 1200

    Game.gem_number = count


def level2():
    Game.player1 = Player1(0, 500, 4)
    Game.playerGroup = pygame.sprite.Group()
    Game.playerGroup.add(Game.player1)

    Game.player2 = Player2(50, 500, 4)
    Game.playerGroup2 = pygame.sprite.Group()
    Game.playerGroup2.add(Game.player2)

    Game.wall = Wall()
    Game.portal = Portal(300, 200)
    Game.monster = Monster(10, 10, 2)
    Game.level_text = "关卡2"
    # [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    # [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
    Game.wall_list = [
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0],
        [1, 1, 1, 1, 1, 0, 5, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0],
        [2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 5, 6, 5, 6],
        [2, 2, 2, 2, 2, 3, 3, 3, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1],
        [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
        [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
        ]
    Game.mini_portal1 = Portal_mini1(-100, 600)
    Game.mini_portal2 = Portal_mini2(-100, 750)
    # 初始化计数器
    count = 0
    Game.fangkuaixiaoshi = False
    # 遍历二维列表，找出所有的5并计数
    for row in Game.wall_list:
        for element in row:
            if element == 5:
                count += 1

    for row in Game.wall_list:
        for element in row:
            if element == 6:
                count += 1

    print(f"二维列表中值为5的元素数量为：{count}")

    Game.monster_list = [

    ]

    Game.monster1_star = 250
    Game.monster1_end = 750

    Game.monster2_star = 150
    Game.monster2_end = 550

    Game.monster3_star = 950
    Game.monster3_end = 1250

    Game.monster4_star = 300
    Game.monster4_end = 700

    Game.monster5_star = 600
    Game.monster5_end = 1200

    Game.gem_number = count


def level3():
    Game.player1 = Player1(0, 700, 4)
    Game.playerGroup = pygame.sprite.Group()
    Game.playerGroup.add(Game.player1)

    Game.player2 = Player2(50, 700, 4)
    Game.playerGroup2 = pygame.sprite.Group()
    Game.playerGroup2.add(Game.player2)

    Game.wall = Wall()
    Game.portal = Portal(0, 250)
    Game.monster = Monster(10, 10, 2)
    Game.level_text = "关卡3"
    # [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    # [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
    # [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
    Game.wall_list = [
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5],
        [1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 3, 3, 3, 1, 1, 1],
        [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
    ]
    Game.mini_portal1 = Portal_mini1(-100, 600)
    Game.mini_portal2 = Portal_mini2(-100, 750)
    # 初始化计数器
    count = 0
    Game.fangkuaixiaoshi = False
    # 遍历二维列表，找出所有的5并计数
    for row in Game.wall_list:
        for element in row:
            if element == 5:
                count += 1

    for row in Game.wall_list:
        for element in row:
            if element == 6:
                count += 1

    print(f"二维列表中值为5的元素数量为：{count}")

    Game.monster_list = [

    ]

    Game.monster1_star = 250
    Game.monster1_end = 750

    Game.monster2_star = 150
    Game.monster2_end = 550

    Game.monster3_star = 950
    Game.monster3_end = 1250

    Game.monster4_star = 300
    Game.monster4_end = 700

    Game.monster5_star = 600
    Game.monster5_end = 1200

    Game.gem_number = count


def level4():
    Game.player1 = Player1(0, 0, 4)
    Game.playerGroup = pygame.sprite.Group()
    Game.playerGroup.add(Game.player1)

    Game.player2 = Player2(50, 0, 4)
    Game.playerGroup2 = pygame.sprite.Group()
    Game.playerGroup2.add(Game.player2)

    Game.wall = Wall()
    Game.portal = Portal(1500, 0)
    Game.monster = Monster(10, 10, 2)
    Game.level_text = "关卡4"
    # [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    # [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
    # [2, 2, 2,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 3, 3, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [6, 5, 6, 5, 0, 0, 0, 0, 0, 1, 2, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 6, 0],
        [5, 6, 5, 6, 0, 0, 0, 0, 1, 2, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 6, 0],
        [1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
    ]
    Game.mini_portal1 = Portal_mini1(-100, 600)
    Game.mini_portal2 = Portal_mini2(-100, 750)
    # 初始化计数器
    count = 0
    Game.fangkuaixiaoshi = False
    # 遍历二维列表，找出所有的5并计数
    for row in Game.wall_list:
        for element in row:
            if element == 5:
                count += 1

    for row in Game.wall_list:
        for element in row:
            if element == 6:
                count += 1

    print(f"二维列表中值为5的元素数量为：{count}")

    Game.monster_list = [
        {"x": 700, "y": 250},
        {"x": 750, "y": 550},
        {"x": 950, "y": 750},
    ]

    Game.monster1_star = 400
    Game.monster1_end = 1100

    Game.monster2_star = 500
    Game.monster2_end = 1250

    Game.monster3_star = 550
    Game.monster3_end = 1250

    Game.monster4_star = 300
    Game.monster4_end = 700

    Game.monster5_star = 600
    Game.monster5_end = 1200

    Game.gem_number = count


def level5():
    Game.player1 = Player1(0, 0, 4)
    Game.playerGroup = pygame.sprite.Group()
    Game.playerGroup.add(Game.player1)

    Game.player2 = Player2(50, 0, 4)
    Game.playerGroup2 = pygame.sprite.Group()
    Game.playerGroup2.add(Game.player2)

    Game.wall = Wall()
    Game.portal = Portal(1500, 0)
    Game.monster = Monster(10, 10, 2)
    Game.level_text = "关卡5"
    # [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    # [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
    Game.wall_list = [
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1],
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0, 5, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
    ]
    Game.mini_portal1 = Portal_mini1(-100, 600)
    Game.mini_portal2 = Portal_mini2(-100, 750)
    # 初始化计数器
    count = 0
    Game.fangkuaixiaoshi = False
    # 遍历二维列表，找出所有的5并计数
    for row in Game.wall_list:
        for element in row:
            if element == 5:
                count += 1

    for row in Game.wall_list:
        for element in row:
            if element == 6:
                count += 1

    print(f"二维列表中值为5的元素数量为：{count}")

    Game.monster_list = [
        {"x": 450, "y": 200},
        {"x": 150, "y": 350},
        {"x": 950, "y": 500},
        {"x": 550, "y": 650},

    ]

    Game.monster1_star = 100
    Game.monster1_end = 1450

    Game.monster2_star = 100
    Game.monster2_end = 1450

    Game.monster3_star = 100
    Game.monster3_end = 1450

    Game.monster4_star = 100
    Game.monster4_end = 1450

    Game.monster5_star = 100
    Game.monster5_end = 1450

    Game.gem_number = count


def level6():
    Game.player1 = Player1(1500, 700, 4)
    Game.playerGroup = pygame.sprite.Group()
    Game.playerGroup.add(Game.player1)

    Game.player2 = Player2(1550, 700, 4)
    Game.playerGroup2 = pygame.sprite.Group()
    Game.playerGroup2.add(Game.player2)

    Game.wall = Wall()
    Game.portal = Portal(1500, 0)
    Game.monster = Monster(10, 10, 2)
    Game.level_text = "关卡6"

    Game.wall_list = [
        [5, 6, 6, 5, 4, 0, 0, 0, 0, 0, 0, 0, 0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0, 1, 0, 0, 0],
        [2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0],
        [2, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 1, 1, 1],
        [2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 6, 5, 6, 5, 6, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0],
        [2, 0, 0, 0, 5, 6, 5, 6, 5, 6, 5, 0, 0, 0, 0, 2, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [2, 1, 0, 0, 5, 6, 5, 6, 5, 6, 5, 0, 0, 0, 0, 2, 2, 0, 0, 0, 2, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0],
        [2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 2, 2, 0, 0, 0, 2, 2, 0, 0, 0, 1, 1],
        [2, 2, 2, 1, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, 3, 2, 2, 3, 3, 3, 2, 2, 3, 3, 3, 2, 2, 3, 3, 3, 2, 2],
    ]
    Game.mini_portal1 = Portal_mini1(-100, 600)
    Game.mini_portal2 = Portal_mini2(-100, 750)
    # 初始化计数器
    count = 0
    Game.fangkuaixiaoshi = False
    # 遍历二维列表，找出所有的5并计数
    for row in Game.wall_list:
        for element in row:
            if element == 5:
                count += 1

    for row in Game.wall_list:
        for element in row:
            if element == 6:
                count += 1

    print(f"二维列表中值为5的元素数量为：{count}")

    Game.monster_list = [
        {"x": 450, "y": 50},
        {"x": 150, "y": 300},
        {"x": 950, "y": 250},
        {"x": 550, "y": 750},
        {"x": 750, "y": 500},
    ]

    Game.monster1_star = 250
    Game.monster1_end = 750

    Game.monster2_star = 150
    Game.monster2_end = 550

    Game.monster3_star = 950
    Game.monster3_end = 1250

    Game.monster4_star = 300
    Game.monster4_end = 700

    Game.monster5_star = 600
    Game.monster5_end = 1200

    Game.gem_number = count

def level7():
    Game.player1 = Player1(0, 780, 4)
    Game.playerGroup = pygame.sprite.Group()
    Game.playerGroup.add(Game.player1)

    Game.player2 = Player2(50, 780, 4)
    Game.playerGroup2 = pygame.sprite.Group()
    Game.playerGroup2.add(Game.player2)

    Game.wall = Wall()
    Game.portal = Portal(700, 300)
    Game.monster = Monster(10, 10, 2)
    Game.mini_portal1 = Portal_mini1(200, 600)
    Game.mini_portal2 = Portal_mini2(1400, 750)
    # [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    # [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
    Game.level_text = "关卡7"
    Game.wall_list = [
        [6, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 5, 2, 0, 0, 0, 0, 0, 5, 6, 0],
        [5, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 6, 2, 0, 0, 0, 0, 0, 5, 6, 0],
        [1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 0, 0, 1, 0, 5, 6, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 6, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 5, 6, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 6, 5, 0, 0, 0, 0,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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 5, 6, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 5, 2, 0, 5, 6, 0],
        [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1],
    ]

    # 初始化计数器
    count = 0
    Game.fangkuaixiaoshi = False
    # 遍历二维列表，找出所有的5并计数
    for row in Game.wall_list:
        for element in row:
            if element == 5:
                count += 1

    for row in Game.wall_list:
        for element in row:
            if element == 6:
                count += 1

    print(f"二维列表中值为5的元素数量为：{count}")

    Game.monster_list = [
        {"x": 450, "y": 0},
        {"x": 860, "y": 150},
        {"x": 950, "y": 300},
        {"x": 790, "y": 600},
        {"x": 850, "y": 750},
    ]

    Game.monster1_star = 0
    Game.monster1_end = 1100

    Game.monster2_star = 500
    Game.monster2_end = 1200

    Game.monster3_star = 850
    Game.monster3_end = 1200

    Game.monster4_star = 300
    Game.monster4_end = 1200

    Game.monster5_star = 0
    Game.monster5_end = 1200

    Game.gem_number = count

def level8():
    Game.player1 = Player1(0, 750, 4)
    Game.playerGroup = pygame.sprite.Group()
    Game.playerGroup.add(Game.player1)

    Game.player2 = Player2(50, 750, 4)
    Game.playerGroup2 = pygame.sprite.Group()
    Game.playerGroup2.add(Game.player2)

    Game.wall = Wall()
    Game.portal = Portal(0, -50)
    Game.monster = Monster(10, 10, 2)
    Game.level_text = "关卡8"
    Game.wall_list = [
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 1, 1, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [6, 6, 6, 3, 5, 5, 5, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 5],
        [1, 1, 1, 1, 1, 1, 1, 2, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 6],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 6, 6],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 6, 6],
        [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
    ]
    Game.mini_portal1 = Portal_mini1(-100, 300)
    Game.mini_portal2 = Portal_mini2(-100, 0)
    # 初始化计数器
    count = 0
    Game.fangkuaixiaoshi = False
    # 遍历二维列表，找出所有的5并计数
    for row in Game.wall_list:
        for element in row:
            if element == 5:
                count += 1

    for row in Game.wall_list:
        for element in row:
            if element == 6:
                count += 1

    print(f"二维列表中值为5的元素数量为：{count}")

    Game.monster_list = [
        {"x": 450, "y": 0},
        {"x": 700, "y": 450},
        {"x": 950, "y": 300},
        {"x": 700, "y": 750},
        {"x": 850, "y": 600},
    ]

    Game.monster1_star = 250
    Game.monster1_end = 1500

    Game.monster2_star = 700
    Game.monster2_end = 1500

    Game.monster3_star = 700
    Game.monster3_end = 1500

    Game.monster4_star = 700
    Game.monster4_end = 1500

    Game.monster5_star = 500
    Game.monster5_end = 1500

    Game.gem_number = count
def level9():
    Game.player1 = Player1(1500, 50, 4)
    Game.playerGroup = pygame.sprite.Group()
    Game.playerGroup.add(Game.player1)

    Game.player2 = Player2(1530, 50, 4)
    Game.playerGroup2 = pygame.sprite.Group()
    Game.playerGroup2.add(Game.player2)

    Game.wall = Wall()
    Game.portal = Portal(0, 0)
    Game.monster = Monster(10, 10, 2)
    Game.level_text = "关卡9"
    Game.wall_list = [
        [0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 1, 1, 1, 0, 0, 0, 5, 6, 5, 0, 0, 0, 0, 0, 0, 6, 5, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [1, 1, 2, 2, 2, 0, 0, 0, 1, 1, 1, 0, 0, 5, 6, 0, 0, 1, 1, 4, 4, 4, 2, 0, 3, 3, 3, 3, 3, 1, 1, 1],
        [2, 6, 6, 0, 0, 0, 0, 0, 2, 2, 3, 3, 3, 1, 1, 3, 3, 2, 2, 4, 4, 4, 2, 0, 2, 2, 2, 2, 2, 2, 3, 3],
        [0, 0, 5, 5, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6],
        [0, 5, 1, 1, 5, 1, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5],
        [0, 2, 2, 2, 1, 2, 2, 2, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 3, 3, 3, 1, 3],
        [0, 6, 2, 2, 2, 2, 2, 6, 0, 0, 0, 0, 6, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 6, 2, 2, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        [0, 0, 0, 6, 2, 6, 0, 0, 0, 1, 1, 1, 1, 1, 1, 3, 3, 3, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0],
        [0, 0, 0, 5, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6, 4, 6, 4, 6, 4, 0, 0],
        [0, 0, 0, 5, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 5, 4, 5, 4, 5, 4, 5],
        [0, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1],
        [0, 4, 5, 6, 5, 6, 5, 4, 6, 5, 6, 5, 6, 4, 5, 6, 5, 6, 5, 4, 6, 5, 6, 5, 6, 4, 5, 6, 5, 6, 5, 6],
        [0, 4, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0],
        [0, 4, 0, 0, 5, 0, 0, 4, 0, 0, 5, 0, 0, 4, 0, 0, 5, 0, 0, 4, 0, 0, 5, 0, 0, 4, 0, 0, 5, 0, 0, 0],
        [1, 1, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 1, 1, 3, 3, 3, 1, 1],
    ]
    Game.mini_portal1 = Portal_mini1(-100, 600)
    Game.mini_portal2 = Portal_mini2(-100, 750)
    # 初始化计数器
    count = 0
    Game.fangkuaixiaoshi = False
    # 遍历二维列表，找出所有的5并计数
    for row in Game.wall_list:
        for element in row:
            if element == 5:
                count += 1

    for row in Game.wall_list:
        for element in row:
            if element == 6:
                count += 1

    print(f"二维列表中值为5的元素数量为：{count}")

    Game.monster_list = [
        {"x": 450, "y": 50},
        {"x": 400, "y": 400},
        {"x": 950, "y": 250},
        {"x": 550, "y": 750},
        {"x": 750, "y": 550},
    ]
    Game.monster1_star = 250
    Game.monster1_end = 750

    Game.monster2_star = 350
    Game.monster2_end = 1500

    Game.monster3_star = 400
    Game.monster3_end = 1500

    Game.monster4_star = 50
    Game.monster4_end = 1150

    Game.monster5_star = 600
    Game.monster5_end = 1000

    Game.gem_number = count
def level10():
    Game.player1 = Player1(0, 750, 4)
    Game.playerGroup = pygame.sprite.Group()
    Game.playerGroup.add(Game.player1)

    Game.player2 = Player2(50, 750, 4)
    Game.playerGroup2 = pygame.sprite.Group()
    Game.playerGroup2.add(Game.player2)
    Game.wall = Wall()
    Game.portal = Portal(1500, 150)
    Game.monster = Monster(10, 10, 2)
    Game.mini_portal1 = Portal_mini1(0, 300)
    Game.mini_portal2 = Portal_mini2(1550, 0)

    Game.level_text = "关卡10"
    # [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    # [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
    Game.wall_list = [
        [6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 5, 0, 0],
        [6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0,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 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0],
        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 6, 5, 0, 0, 0, 1, 1, 3, 3, 3, 1],
        [0, 0, 0, 0, 0, 0, 6, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 4, 6, 0, 6, 2],
        [0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 2, 3, 3, 3, 3, 0, 0, 0, 4, 0, 5, 5, 2],
        [1, 1, 1, 1, 3, 3, 1, 1, 3, 3, 3, 1, 2, 2, 3, 3, 3, 3, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
    ]

    # 初始化计数器
    count = 0
    Game.fangkuaixiaoshi = False
    # 遍历二维列表，找出所有的5并计数
    for row in Game.wall_list:
        for element in row:
            if element == 5:
                count += 1

    for row in Game.wall_list:
        for element in row:
            if element == 6:
                count += 1

    print(f"二维列表中值为5的元素数量为：{count}")

    Game.monster_list = [
        {"x": 450, "y": 0},
        {"x": 600, "y": 150},
        {"x": 700, "y": 300},
        {"x": 800, "y": 450},
        {"x": 1300, "y": 600},
        {"x": 1200, "y": 750},
    ]
    Game.monster1_star = 250
    Game.monster1_end = 1200

    Game.monster2_star = 450
    Game.monster2_end = 1100

    Game.monster3_star = 700
    Game.monster3_end = 1100

    Game.monster4_star = 1050
    Game.monster4_end = 1400

    Game.monster5_star = 1050
    Game.monster5_end = 1500

    Game.monster6_star = 1050
    Game.monster6_end = 1500

    Game.gem_number = count